import axios from "@/api";


export const addsensorAPI = (data: any) => {
    return axios({
        url: "/service/sensor",
        method: "post",
        data
    });
};


export const getsensorListAPI = (obj: any, data: any) => {
    return axios({
        url: "/service/page/sensor?paged=" + obj.paged+"&pageSize="+obj.pageSize,
        method: "post",
        data
    });
};

export const getsensorListByIdAPI = (id) => {
  return axios({
      url: "/service/sensor?id=" + id,
      method: "get",
  
  });
};

export const updatesensorAPI = (data: any) => {
    return axios({
      url: "/service/sensor",
      method: "put",
      data
    });
  };

export const deletesensorAPI = (data: any) => {
    return axios({
      url: "/service/sensor?id="+data,
      method: "delete",
      
    });
  };

  //http://10.10.1.21:8080/service/page/sensor/history?pageSize=100&paged=1 历史数据
  export const getSensorhistory = (data: any) => {
    return axios({
      url: "/service/page/sensor/history?pageSize=500&paged=1",
      method: "post",
      data
    });
  };
